﻿using Microsoft.AspNetCore.Html;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Text.Encodings.Web;

namespace Ls.Web.Framework.Html
{
    public class StringContent : IHtmlContent
    {
        private StringBuilder html = new StringBuilder();
        public StringContent()
        { 
        }
        public StringContent(string h) {
            html.Append(h);
        }

        public void Append(string h) {
            html.Append(h);
        }
        public void AppendFormat(string h, params object[] args)
        {
            html.AppendFormat(h, args);
        }
        public void WriteTo(TextWriter writer, HtmlEncoder encoder)
        {
            writer.Write(html.ToString());
        }
    }
}
